﻿using System;
using System.IO;

namespace Character
{
	// Token: 0x020001AD RID: 429
	public class WearParameter : ParameterBase
	{
		// Token: 0x06000B13 RID: 2835 RVA: 0x00040550 File Offset: 0x0003E750
		public WearParameter(SEX sex) : base(sex)
		{
			for (int i = 0; i < this.wears.Length; i++)
			{
				this.wears[i] = new WearCustom(sex, (WEAR_TYPE)i, 0);
			}
		}

		// Token: 0x06000B14 RID: 2836 RVA: 0x000405A8 File Offset: 0x0003E7A8
		public WearParameter(WearParameter copy) : base(copy.sex)
		{
			for (int i = 0; i < copy.wears.Length; i++)
			{
				this.wears[i] = new WearCustom(copy.wears[i]);
			}
			this.isSwimwear = copy.isSwimwear;
			this.swimOptTop = copy.swimOptTop;
			this.swimOptBtm = copy.swimOptBtm;
		}

		// Token: 0x06000B15 RID: 2837 RVA: 0x00040630 File Offset: 0x0003E830
		public void Init()
		{
			for (int i = 0; i < this.wears.Length; i++)
			{
				this.wears[i].Init();
			}
			this.isSwimwear = false;
			this.swimOptTop = true;
			this.swimOptBtm = true;
		}

		// Token: 0x06000B16 RID: 2838 RVA: 0x00040678 File Offset: 0x0003E878
		public int GetWearID(WEAR_TYPE type)
		{
			if (this.wears[(int)type] != null)
			{
				return this.wears[(int)type].id;
			}
			return -1;
		}

		// Token: 0x06000B17 RID: 2839 RVA: 0x00040698 File Offset: 0x0003E898
		public void Save(BinaryWriter writer, SEX sex)
		{
			for (int i = 0; i < this.wears.Length; i++)
			{
				this.wears[i].Save(writer);
			}
			if (sex == SEX.FEMALE)
			{
				base.Write(writer, this.isSwimwear);
				base.Write(writer, this.swimOptTop);
				base.Write(writer, this.swimOptBtm);
			}
		}

		// Token: 0x06000B18 RID: 2840 RVA: 0x000406FC File Offset: 0x0003E8FC
		public void Load(BinaryReader reader, SEX sex, CUSTOM_DATA_VERSION version)
		{
			for (int i = 0; i < this.wears.Length; i++)
			{
				this.wears[i].Load(reader, sex, version);
			}
			if (sex == SEX.FEMALE)
			{
				base.Read(reader, ref this.isSwimwear);
				base.Read(reader, ref this.swimOptTop);
				base.Read(reader, ref this.swimOptBtm);
			}
		}

		// Token: 0x06000B19 RID: 2841 RVA: 0x00040760 File Offset: 0x0003E960
		public void Copy(WearParameter source)
		{
			this.isSwimwear = source.isSwimwear;
			this.swimOptTop = source.swimOptTop;
			this.swimOptBtm = source.swimOptBtm;
			for (int i = 0; i < this.wears.Length; i++)
			{
				this.wears[i].Copy(source.wears[i]);
			}
		}

		// Token: 0x06000B1A RID: 2842 RVA: 0x000407C0 File Offset: 0x0003E9C0
		public void DisposeCoordinate(SEX sex)
		{
			WearData wearData = CustomDataManager.GetWearData(sex, WEAR_TYPE.TOP, this.GetWearID(WEAR_TYPE.TOP));
			WearData wearData2 = CustomDataManager.GetWearData(sex, WEAR_TYPE.BOTTOM, this.GetWearID(WEAR_TYPE.BOTTOM));
			if (this.isSwimwear)
			{
				int num = 0;
				int num2 = 1;
				int num3 = 2;
				int num4 = 3;
				this.wears[num].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num] : CustomDataManager.noWears_Female[num]);
				this.wears[num2].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num2] : CustomDataManager.noWears_Female[num2]);
				this.wears[num3].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num3] : CustomDataManager.noWears_Female[num3]);
				this.wears[num4].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num4] : CustomDataManager.noWears_Female[num4]);
			}
			else
			{
				int num5 = 4;
				int num6 = 5;
				int num7 = 6;
				this.wears[num5].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num5] : CustomDataManager.noWears_Female[num5]);
				this.wears[num6].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num6] : CustomDataManager.noWears_Female[num6]);
				this.wears[num7].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num7] : CustomDataManager.noWears_Female[num7]);
				bool flag = false;
				bool flag2 = false;
				bool flag3 = false;
				if (wearData != null)
				{
					if (wearData.braDisable)
					{
						flag = true;
					}
					if (wearData.shortsDisable)
					{
						flag2 = true;
					}
					if (wearData.coordinates == 2)
					{
						flag3 = true;
					}
				}
				if (wearData2 != null)
				{
					if (wearData2.braDisable)
					{
						flag = true;
					}
					if (wearData2.shortsDisable)
					{
						flag2 = true;
					}
				}
				if (flag)
				{
					int num8 = 2;
					this.wears[num8].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num8] : CustomDataManager.noWears_Female[num8]);
				}
				if (flag2)
				{
					int num9 = 3;
					this.wears[num9].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num9] : CustomDataManager.noWears_Female[num9]);
				}
				if (flag3)
				{
					int num10 = 1;
					this.wears[num10].id = ((sex != SEX.FEMALE) ? CustomDataManager.noWears_Male[num10] : CustomDataManager.noWears_Female[num10]);
				}
			}
		}

		// Token: 0x06000B1B RID: 2843 RVA: 0x00040A1C File Offset: 0x0003EC1C
		public void CheckHasData()
		{
			for (int i = 0; i < this.wears.Length; i++)
			{
				this.wears[i].CheckHasData();
			}
		}

		// Token: 0x04000B88 RID: 2952
		public WearCustom[] wears = new WearCustom[11];

		// Token: 0x04000B89 RID: 2953
		public bool isSwimwear;

		// Token: 0x04000B8A RID: 2954
		public bool swimOptTop = true;

		// Token: 0x04000B8B RID: 2955
		public bool swimOptBtm = true;
	}
}
